A Hiking Trip Through the Orders of Magnitude: Deriving Efficient Generators for Closed Simply-Typed Lambda Terms and Normal Forms
نویسنده
چکیده
Contrary to several other families of lambda terms, no closed formula or generating function is known and none of the sophisticated techniques devised in analytic combinatorics can currently help with counting or generating the set of simply-typed closed lambda terms of a given size. Moreover, their asymptotic scarcity among the set of closed lambda terms makes counting them via brute force generation and type inference quickly intractable, with previous published work showing counts for them only up to size 10. By taking advantage of the synergy between logic variables, unification with occurs check and efficient backtracking in today’s Prolog systems, we climb 4 orders of magnitude above previously known counts by deriving progressively faster Horn Clause programs that generate and/or count the set of closed simply-typed lambda terms of sizes up to 14. A similar count for closed simply-typed normal forms is also derived up to size 14.
منابع مشابه
A Hiking Trip Through the Orders of 1 Magnitude : Deriving Efficient Generators for 2 Closed Simply - Typed Lambda Terms and 3 Normal Forms
Contrary to several other families of lambda terms, no closed 9 formula or generating function is known and none of the sophisticated 10 techniques devised in analytic combinatorics can help with counting or 11 generating the set of simply-typed closed lambda terms of a given size. 12 Moreover, their asymptotic scarcity among the set of closed lambda 13 terms makes counting them via brute force...
متن کاملOn lambda-term skeletons, with applications to all-term and random-term generation of simply-typed closed lambda terms
Lambda terms in de Bruijn notation are Motzkin trees (also called binary-unary trees) with indices at their leaves counting up to a binder among the lambdas on the path to the root labeling their leaves. Define the skeleton of a lambda term as the Motzkin tree obtained by erasing the de Bruijn indices labeling their leaves. Then, given a Motzkin tree, one can ask if it is the skeleton of at lea...
متن کاملNormalization by Evaluation for Typed Lambda Calculus with Coproducts
Abstract We solve the decision problem for simply typed lambda calculus with strong binary sums, equivalently the word problem for free cartesian closed categories with binary coproducts. Our method is based on the semantical technique known as “normalization by evaluation” and involves inverting the interpretation of the syntax into a suitable sheaf model and from this extracting appropriate u...
متن کاملOn Uniquely Closable and Uniquely Typable Skeletons of Lambda Terms
Uniquely closable skeletons of lambda terms are Motzkin-trees that predetermine the unique closed lambda term that can be obtained by labeling their leaves with de Bruijn indices. Likewise, uniquely typable skeletons of closed lambda terms predetermine the unique simply-typed lambda term that can be obtained by labeling their leaves with de Bruijn indices. We derive, through a sequence of logic...
متن کاملCategorical completeness results for the simply-typed lambda-calculus
We investigate, in a categorical setting, some completeness properties of beta-eta conversion between closed terms of the simply-typed lambda calculus. A cartesian-closed category is said to be complete if, for any two unconvertible terms, there is some interpretation of the calculus in the category that distinguishes them. It is said to have a complete interpretation if there is some interpret...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2016